/*
 * @Descripttion:
 * @version:
 * @Author: sueRimn
 * @Date: 2020-10-21 18:10:42
 * @LastEditors: sueRimn
 * @LastEditTime: 2020-11-14 16:59:03
 * 文档地址：http://lz.25002.cn/msmcenter_api/index.php
 */
import request from '@/utils/request'
import store from '@/store/index'
const base = require('../../env/index')

// 夹带k_token
function addK_Token(data) {
    var token = {
        k_token: store.getters.k_token
    }
    Object.assign(data, token)
    return data
}

/**
 * 查询学生列表
 */
export function getStu(data) {
    return request({
        url: base.classmanagement_url + '/api/v1/admin/student/infos',
        method: 'POST',
        headers: {},
        data: addK_Token(data)
    })
}

/**
 * 查询收费课程列表
 */
export function getShoufeiCourse(data) {
    return request({
        url: base.classmanagement_url + '/api/v1/admin/pay/lession/infos',
        method: 'POST',
        headers: {},
        data: addK_Token(data)
    })
}

/**
 * 查询其他收费列表
 */
export function getOtherPayAPI(data) {
    return request({
        url: base.classmanagement_url + '/api/v1/admin/pay/item/infos',
        method: 'POST',
        headers: {},
        data: addK_Token(data)
    })
}

/**
 * 新建订单
 */
export function submitOrder(data) {
    return request({
        url: base.classmanagement_url + '/api/v1/admin/order/save',
        method: 'POST',
        headers: {},
        data: addK_Token(data)
    })
}
/**
 * 查询订单
 */
export function getOrder(data) {
    return request({
        url: base.classmanagement_url + '/api/v1/admin/order/infos',
        method: 'POST',
        headers: {},
        data: addK_Token(data)
    })
}
/**
 * 删除订单
 */
export function deleteOrderApi(data) {
    return request({
        url: base.classmanagement_url + '/api/v1/admin/order/delete/' + data.unid,
        method: 'POST',
        headers: {},
        data: addK_Token(data)
    })
}
/**
 * 获取当前行订单信息
 */
export function getOrderInfoAPI(data) {
    return request({
        url: base.classmanagement_url + '/api/v1/admin/order/info/' + data.unid,
        method: 'POST',
        headers: {},
        data: addK_Token(data)
    })
}

/**
 *新建退费
 */
export function addTuiFeiApi(data) {
    return request({
        url: base.classmanagement_url + '/api/v1/admin/return/fees/save',
        method: 'POST',
        headers: {},
        data: addK_Token(data)
    })
}

/**
 *获取部门
 */
export function getBumenApi(data) {
    return request({
        url: base.classmanagement_url + '/api/v1/admin/return/fees/getRoleList',
        method: 'POST',
        headers: {},
        data: addK_Token(data)
    })
}

/**
 *分页查询退费
 */
export function getTuifeiAPI(data) {
    return request({
        url: base.classmanagement_url + '/api/v1/admin/return/fees/infos',
        method: 'POST',
        headers: {},
        data: addK_Token(data)
    })
}

/**
 *删除退费
 */
export function deleteTuifeiAPI(data) {
    return request({
        url: base.classmanagement_url + '/api/v1/admin/return/fees/delete/' + data.unid,
        method: 'POST',
        headers: {},
        data: addK_Token(data)
    })
}

/**
 *删除退费
 */
export function getTuifeiRowApi(data) {
    return request({
        url: base.classmanagement_url + '/api/v1/admin/return/fees/info/' + data.unid,
        method: 'POST',
        headers: {},
        data: addK_Token(data)
    })
}
/**
 *获取课程下必须购买项目
 */
export function getCOurseMustAPI(data) {
    return request({
        url: base.classmanagement_url + '/api/v1/admin/order/must/' + data.unid,
        method: 'POST',
        headers: {},
        data: addK_Token(data)
    })
}

// 添加学员
export function addStu(data) {
    return request({
        url: base.classmanagement_url + '/api/v1/admin/student/save',
        method: 'POST',
        headers: {},
        data: addK_Token(data)
    })
}
// 查询学期作息表时间
export function searchzuoxiTime(data) {
    return request({
        url: base.classmanagement_url + '/api/v1/admin/student/save',
        method: 'POST',
        headers: {},
        data: addK_Token(data)
    })
}
// 查询订单统计
export function gettongjiApi(data) {
    return request({
        url: base.classmanagement_url + '/api/v1/admin/order/statistics',
        method: 'POST',
        headers: {},
        data: addK_Token(data)
    })
}
